package a.g;

import a.d.s;
import a.f.t;
import a.h.dc;
import a.h.z;

public class m
  extends h
{
  private static final String q = "COMPONENTLAYOUTER";
  private static final String r = "STYLE";
  private static final String s = "STYLE_NONE";
  private static final String t = "STYLE_ROWS";
  private static final String u = "STYLE_SINGLE_ROW";
  private static final String v = "STYLE_SINGLE_COLUMN";
  private static final String w = "STYLE_PACKED_COMPACT_RECTANGLE";
  private static final String x = "STYLE_PACKED_RECTANGLE";
  private static final String y = "STYLE_PACKED_CIRCLE";
  private static final String z = "STYLE_PACKED_COMPACT_CIRCLE";
  private static final String A = "FROM_SKETCH";
  private static final String B = "NO_OVERLAP";
  private static final String C = "ASPECT_RATIO";
  private static final String D = "USE_SCREEN_RATIO";
  private static final String E = "COMPONENT_SPACING";
  private static final String F = "GRID_SPACING";
  private static final String G = "GRID_ENABLED";
  private static final String[] H = { "STYLE_NONE", "STYLE_ROWS", "STYLE_SINGLE_ROW", "STYLE_SINGLE_COLUMN", "STYLE_PACKED_RECTANGLE", "STYLE_PACKED_COMPACT_RECTANGLE", "STYLE_PACKED_CIRCLE", "STYLE_PACKED_COMPACT_CIRCLE" };
  private t I;
  public static boolean J;
  
  public m()
  {
    super("COMPONENTLAYOUTER", "yFiles Layout Team", "Wrapper for ComponentLayouter");
  }
  
  protected dc j()
  {
    int i = f.p;
    if ((i != 0) || (this.I == null)) {
      z();
    }
    dc localdc = new dc(a());
    z localz = new z(localdc);
    localdc.a("STYLE", H, this.I.h() & 0x1F);
    if (i == 0) {}
    localdc.a("NO_OVERLAP", (this.I.h() & 0x40) != 0);
    if (i == 0) {}
    localdc.a("FROM_SKETCH", (this.I.h() & 0x20) != 0);
    s locals = this.I.b();
    localdc.a("USE_SCREEN_RATIO", true);
    localdc.a("ASPECT_RATIO", locals.a / locals.b);
    localz.a("USE_SCREEN_RATIO", Boolean.FALSE, "ASPECT_RATIO");
    localdc.a("COMPONENT_SPACING", this.I.f(), 0.0D, 400.0D);
    if (i == 0) {}
    localdc.a("GRID_ENABLED", this.I.e() > 0.0D);
    if (i == 0) {}
    localdc.a("GRID_SPACING", this.I.e() > 0.0D ? this.I.e() : 20.0D);
    localz.a("GRID_ENABLED", Boolean.TRUE, "GRID_SPACING");
    return localdc;
  }
  
  protected void m()
  {
    int i = f.p;
    boolean bool = f.o;
    z();
    dc localdc = i();
    this.I.b(true);
    byte b = (byte)localdc.i("STYLE");
    if (i == 0) {
      if (localdc.g("NO_OVERLAP")) {
        b = (byte)(b | 0x40);
      }
    }
    if (i == 0)
    {
      if (localdc.g("FROM_SKETCH")) {
        b = (byte)(b | 0x20);
      }
      this.I.a(b);
      if (i != 0) {}
    }
    else if (localdc.g("USE_SCREEN_RATIO"))
    {
      if ((i != 0) || (g() != null))
      {
        d1 = g().getWidth();
        d2 = g().getHeight();
        if (i != 0) {
          break label198;
        }
        if (!bool) {
          break label164;
        }
      }
    }
    double d1 = localdc.f("ASPECT_RATIO");
    double d2 = 1.0D / d1;
    d1 *= 400.0D;
    d2 *= 400.0D;
    label164:
    this.I.a(d1, d2);
    if (i == 0)
    {
      this.I.b(localdc.f("COMPONENT_SPACING"));
      if (localdc.g("GRID_ENABLED"))
      {
        label198:
        if (i != 0) {
          break label229;
        }
        this.I.a(localdc.f("GRID_SPACING"));
        if (!bool) {
          return;
        }
      }
    }
    label229:
    this.I.a(0.0D);
  }
  
  protected void n()
  {
    a(this.I);
  }
  
  protected void o()
  {
    this.I = null;
  }
  
  private void z()
  {
    if ((f.p != 0) || (this.I == null)) {
      this.I = new t();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.m

 * JD-Core Version:    0.7.0.1

 */